package com.shiyi.design.strategy;

/**
 * @Author qiu
 * @Date 2021/1/11 3:44
 */
public enum FireStrategyEnum {

    BULLET_FIRE_STRATEGY("com.shiyi.design.strategy.BulletFireStrategy", "bullet"),
    LASER_FIRE_STRATEGY("com.shiyi.design.strategy.LaserFireStrategy", "laser"),
    N_BOMB_FIRE_STRATEGY("com.shiyi.design.strategy.NBombFireStrategy", "N-bomb");

    private String className;

    private String BizType;

    FireStrategyEnum(String className, String bizType) {
        this.className = className;
        BizType = bizType;
    }

    public String getClassName() {
        return className;
    }

    public String getBizType() {
        return BizType;
    }

    public static FireStrategyEnum parse(String bizType) {
        if(bizType == null || bizType.length() == 0) {
            return null;
        }

        FireStrategyEnum[] fireStrategyEnums = FireStrategyEnum.values();
        for (FireStrategyEnum fireStrategyEnum : fireStrategyEnums) {
            if(fireStrategyEnum.getBizType().equals(bizType)) {
                return fireStrategyEnum;
            }
        }

        return null;
    }
}
